<?php

/* @var $this \yii\web\View */
/* @var $content string */

use yii\helpers\Html;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;
use app\assets\FrontAsset;
use app\components\Check;

FrontAsset::register($this);
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
    <meta charset="<?= Yii::$app->charset ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <?= Html::csrfMetaTags() ?>
    <title><?= Html::encode($this->title) ?></title>
    
    <?php $this->head() ?>
    <style type="text/css">
        .navbar-inverse {
                            background-color: #d9edf7;
                            border-color: #dddddd;
                        }
        .navbar-inverse .navbar-nav > .open > a, .navbar-inverse .navbar-nav > .open > a:hover, .navbar-inverse .navbar-nav > .open > a:focus {
                            color: #fff;
                            background-color: rgba(51, 122, 183, 0.38);
                        }
        .navbar-inverse .navbar-nav > li > a {
                                                    color: #333333;
                                                }   
        .navbar-inverse .btn-link {
                                                    color: #333333;
                                                }
        .navbar-inverse .navbar-brand {
                                                    color: #333333;
                                                }
        a {
                            color: rgba(51, 122, 183, 0.48);
                            text-decoration: none;
                        }
                        
        .dropdown-menu > .active > a, .dropdown-menu > .active > a:hover, .dropdown-menu > .active > a:focus {
                                color: #fff;
                                text-decoration: none;
                                background-color: #5bc0de;
                                outline: 0;
                            }
         .navbar-inverse .navbar-nav > .active > a, .navbar-inverse .navbar-nav > .active > a:hover, .navbar-inverse .navbar-nav > .active > a:focus {
                                color: #fff;
                                background-color: #9ac1df;
                            }
    </style>
</head>
<body>
<?php $this->beginBody() ?>

<div class="wrap">
    <?php
    NavBar::begin([
        'brandLabel' => '',
        'brandUrl' => '#',
        'options' => [
            'class' => 'navbar-inverse navbar-fixed-top',
        ],
    ]);
    echo '<div class="navbar-header"> <h4>广西大学新闻传播学院学生信息服务平台</h4> </div>';
    echo Nav::widget([
        'options' => ['class' => 'navbar-nav navbar-right'],
        'items' => [
        		['label' => '基本信息', 'items' => [
        				['label' => '个人信息', 'url' => ['/front/index']],
        				['label' => '学籍信息', 'url' => ['/front/xjxx']],
        				['label' => '住宿信息', 'url' => ['/front/dorm']],
        				['label' => '家庭情况', 'url' => ['/frontfamily/index']],
        		]],
        		['label' => '纪律检查', 'items' => [
        				['label' => '课堂考勤记录', 'url' => ['/jljc/index']],
        				['label' => '活动考勤记录', 'url' => ['/jljc/hdkq']],
        				['label' => '熄灯断网执行记录', 'url' => ['/jljc/xddw']],
        				['label' => '卫生检查记录', 'url' => ['/jljc/wsjc']],
        				['label' => '违纪预警情况', 'url' => ['/jljc/wjyj']],
        				['label' => '违纪处分情况', 'url' => ['/jljc/wjcf']],
        				
        		]],
        	
        		['label' => '综合表现', 'items' => [
        				['label' => '文体活动', 'url' => ['/show/literary']],
        				['label' => '社会工作', 'url' => ['/show/socialwork']],
        				['label' => '奖励资助', 'url' => ['/show/rewardfunding']],
        				['label' => '荣誉称号', 'url' => ['/show/honortitle']],
        		]],
        		['label' => '申请服务', 'items' => [
        				['label' => '教室使用', 'url' => ['/apply/classroomindex']],
        				['label' => '物资借用', 'url' => ['/apply/material']],
        		]],
           
        		['label' => '账号维护', 'items' => [
        				['label' => '账号信息', 'url' => ['/front/information']],
        				['label' => '客户服务', 'url' => ['/front/station']],
        		]],
        		(Check::check()) ? (
        				'<li>'
        						. Html::beginForm(['/front/logout'], 'post', ['class' => 'navbar-form'])
        						. Html::submitButton(
        								'退出登录 （' . Yii::$app->session->get('stu')['stuname']. '）',
        								['class' => 'btn btn-link']
        								)
        								. Html::endForm()
        								. '</li>'       				              
            ) : (
            		['label' => '登录', 'url' => ['/front/login']]
            )
        ],
    ]);
    NavBar::end();
    ?>

    <div class="container">
        <?= Breadcrumbs::widget([
        	 'homeLink' => [ 'label' => '首页','url' => Yii::getAlias ( '@web' ) . '/front' ],
            'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
        ]) ?>
        <?= $content ?>
    </div>
</div>

<footer class="footer">
    <div class="container">
        <p class="pull-left">&copy; 新闻传播学院 <?= date('Y') ?></p>     
    </div>
</footer>

<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>
